import request from '@/utils/request'

// 创建学习记录
export function createCourseRecord(data) {
  return request({
    url: '/exam/course-record/create',
    method: 'post',
    data: data
  })
}

// 更新学习记录
export function updateCourseRecord(data) {
  return request({
    url: '/exam/course-record/update',
    method: 'put',
    data: data
  })
}

// 删除学习记录
export function deleteCourseRecord(id) {
  return request({
    url: '/exam/course-record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得学习记录
export function getCourseRecord(id) {
  return request({
    url: '/exam/course-record/get?id=' + id,
    method: 'get'
  })
}

// 获得学习记录分页
export function getCourseRecordPage(query) {
  return request({
    url: '/exam/course-record/page',
    method: 'get',
    params: query
  })
}

// 导出学习记录 Excel
export function exportCourseRecordExcel(query) {
  return request({
    url: '/exam/course-record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
